﻿
<section id="directives-calendar" ng-controller="scheduleCtrl">
    <div class="box">
        <div class="box-header">
            <div class="row">
                <div class="col-md-12" ng-if="personIsSelected == true" ng-include="'ContentMedora/ehr/personShortInfo.html'"></div>
                
            </div>
            </div>
        <div class="box-body">
            <div class="row">
                <div class="col-md-2">
                    <div class="box box-primary">
                        <div class="box-header">
                            <h3 class="box-title">{{institutionName}}</h3>
                        </div>
                        <div class="box-body">
                            <div class="form-group">
                                <label>Date</label>
                                <input type="date" class="form-control" ng-model="selectedDate" ng-change="goToDate()" />
                            </div>
                            <div class="form-group">
                                <label>Department</label>
                                <select class="form-control" ng-model="dep" ng-options="d.value for d in departments" ng-change="changeDepartment(dep)" />
                            </div>
                            <div class="form-group">
                                <label>Provider</label>
                                <select class="form-control" ng-model="pro" ng-options="p.fullName for p in providers" />

                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-9">
                    <div class="row" ng-show="selectedEvent != undefined">
                        <div class="col-md-7 alert alert-danger" style="padding-top: 5px; padding-bottom: 5px; position: absolute; z-index: 100;">
                            <button type="button" class="close" ng-click="closeAction()">×</button>
                            <div>
                                <div class="col-md-9"><b> {{selectedEvent.start | date:'dd MMM, yyyy HH:mm'}}-{{selectedEvent.end | date:'HH:mm'}}</b> to {{pro.fullName}}</div>
                                <div class="col-md-9" ng-if="selectedEvent.title!==''"> <input type="text" name="reason" style="width:95%" ng-model="selectedEvent.reasonForClear" focus-me="selectedEvent.isFocused" /></div>
                                <div class="col-md-9" ng-if="selectedEvent.title===''">&nbsp;</div>
                                <div class="col-md-3 text-right">

                                    <button type="button" ng-if="selectedEvent.title===''" ng-click="save()"><i class="fa fa-save"></i> Save </button>
                                    <button type="button" ng-if="selectedEvent.title!==''" ng-click="clear()"><i class="fa fa-trash-o"></i> Delete </button>
                                </div>
                            </div>
                        </div>

                    </div>
                    <!-- <div class="btn-toolbar">
                     <div class="btn-group">
                         <button class="btn btn-success" ng-click="changeView('agendaDay', scheduling)">AgendaDay</button>
                         <button class="btn btn-success" ng-click="changeView('agendaWeek', scheduling)">AgendaWeek</button>
                         <button class="btn btn-success" ng-click="changeView('month', scheduling)">Month</button>
                     </div>
                 </div>-->
                    <div class="calendar" ng-model="eventSources" calendar="scheduling" config="uiConfig.calendar" ui-calendar="uiConfig.calendar"></div>
                </div>
                <div class="col-md-1">
                    <div data-ng-include="'ContentMedora/scheduling/scheduleLegend.html'"></div>
                </div>
            </div>
        </div>
        </div>
</section>
